Microsoft DirectX 8.1 (C++)

Compositions and Layering

You can think of each video track as occupying its own layer. In a collection of tracks, the first track has the lowest priority (priority 0) and each subsequent track has a priority one level higher. At each layer, the source clips in that layer hide the source clips in the layers below it, unless that layer also contains a transition. Thus you can imagine DES making several passes when it renders:

First, it renders Track 0. There is nothing "under" Track 0, so empty regions are rendered as a solid black image. Transitions in this layer occur between the black image and Track 0 or vice versa. (For example, the video clip fades from black.) DES then lays Track 1 on top of Track 0, generating any transitions between the two tracks. The result is the composite of the two tracks. Next, it places Track 2 onto this composite. Transitions at this layer occur between the composite and Track 2. The process continues until the last (highest-priority) track is put down.

When several tracks are composited together, they behave like a single track (called a virtual track). In DES, the composition object encapsulates this behavior. You can insert multiple tracks into a composition, and then insert the composition into another composition (which might contain other tracks, or even other compositions). The first composition behaves as a single layer within the larger composition.

Complex results are possible with this model. For example, one video clip can wipe to a second clip, while at the same time the composite (the two clips plus the wipe) fades into a third clip.